package system;

import bean.AnnouncementBean;
import dao.AnnouncementDAO;
import dao.DAO;

/**
 * Class responsible for the operations of announcement 
 * @author Laura Dutra
 *
 */
public class Announcement {
 
	private AnnouncementBean bean;
	private DAO<AnnouncementBean> announcementdao = AnnouncementDAO.getInstance();
	
	/**
	 * Constructor
	 * @param id
	 * @param blogId
	 */
	public Announcement(String id, String blogId) {
		bean = new AnnouncementBean(id, blogId);
		if(!announcementdao.contains(bean))
			announcementdao.save(bean);
	}

	/**
	 * @return the blogId
	 */
	public String getBlogId() {
		return bean.getBlogId();
	}

	/**
	 * @param blogId the blogId to set
	 */
	public void setBlogId(String blogId) {
		;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return bean.getId();
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		;
	}

	/**
	 * Delete a announcement
	 */
	public void delete() {
		announcementdao.delete(bean);
		
	}
	
	
}
 
